// by Xeno
//#define __DEBUG__
#define THIS_FILE "fn_preinit.sqf"
#include "x_setup.sqf"
diag_log format ["############################# %1 #############################", missionName];
diag_log [diag_frameno, diag_ticktime, time, "Executing Dom fn_preinit.sqf"];

// publicVariable and marker related stuff does not work in preinit!!!

if (isClass (configFile/"CfgPatches"/"dayz")) exitWith {
	diag_log "ATTENTION!!! Remove the DayZ mod!";
	diag_log "Domination ends!";
	endMission "LOSER";
};

/*if (productVersion select 3 < 111471) exitWith {
	diag_log "ATTENTION!!! Dom needs version 111471 or higher!";
	diag_log "Domination ends!";
	endMission "LOSER";
};*/

// TYRGHEN - Island specific stuffs
call compile preprocessFileLineNumbers "island\preinit.sqf";

GVAR(HeliHEmpty) = "Land_HelipadEmpty_F";

if (isServer) then {
#include "x_paramshelper.sqf"
};

GVAR(doRespawnGroups) =
#ifdef __RESPAWN_GROUPS__
	true;
#else
	false;
#endif

// BLUFOR, OPFOR or INDEPENDENT for own side, setup in x_setup.sqf
#ifdef __OWN_SIDE_BLUFOR__
GVAR(own_side) = "BLUFOR";
GVAR(enemy_side) = "OPFOR";
GVAR(enemy_side_trigger) = "EAST";
#endif
#ifdef __OWN_SIDE_OPFOR__
GVAR(own_side) = "OPFOR";
GVAR(enemy_side) = "BLUFOR";
GVAR(enemy_side_trigger) = "WEST";
#endif
#ifdef __OWN_SIDE_INDEPENDENT__
GVAR(own_side) = "INDEPENDENT";
GVAR(enemy_side) = "OPFOR";
GVAR(enemy_side_trigger) = "EAST";
#endif
#ifdef __TT__
GVAR(enemy_side) = "INDEPENDENT";
GVAR(own_side) = "BLUFOR";
GVAR(enemy_side_trigger) = "GUER";
#endif

GVAR(random_sm_array) = (GVAR(random_sm_array) == 0);

// TODO: Remove again once other objects like mgnests are available *sigh*
GVAR(with_mgnest) = false;
// TODO END

GVAR(side_enemy) = switch (GVAR(enemy_side)) do {
	case "OPFOR": {opfor};
	case "BLUFOR": {blufor};
	case "INDEPENDENT": {independent};
};

GVAR(side_player) =
#ifdef __OWN_SIDE_OPFOR__
	opfor;
#endif
#ifdef __OWN_SIDE_BLUFOR__
	blufor;
#endif
#ifdef __OWN_SIDE_INDEPENDENT__
	independent;
#endif
#ifdef __TT__
	blufor;
#endif

GVAR(side_player_str) =
#ifdef __OWN_SIDE_OPFOR__
	"opfor";
#endif
#ifdef __OWN_SIDE_BLUFOR__
	"blufor";
#endif
#ifdef __OWN_SIDE_INDEPENDENT__
	"independent";
#endif
#ifdef __TT__
	"blufor";
#endif

GVAR(own_side_trigger) =
#ifdef __OWN_SIDE_OPFOR__
	"EAST";
#endif
#ifdef __OWN_SIDE_BLUFOR__
	"WEST";
#endif
#ifdef __OWN_SIDE_INDEPENDENT__
	"GUER";
#endif
#ifdef __TT__
	"WEST";
#endif

GVAR(own_side_trigger_alt) =
#ifdef __OWN_SIDE_OPFOR__
	"OPFOR";
#endif
#ifdef __OWN_SIDE_BLUFOR__
	"BLUFOR";
#endif
#ifdef __OWN_SIDE_INDEPENDENT__
	"INDEPENDENT";
#endif
#ifdef __TT__
	"BLUFOR";
#endif

GVAR(ai_enemy_sides) =
#ifdef __OWN_SIDE_OPFOR__
	[blufor];
#endif
#ifdef __OWN_SIDE_BLUFOR__
	[opfor];
#endif
#ifdef __OWN_SIDE_INDEPENDENT__
	[opfor];
#endif
#ifdef __TT__
	[opfor,blufor];
#endif

GVAR(rep_truck_blufor) = "B_Truck_01_Repair_F";
GVAR(rep_truck_opfor) = "O_Truck_02_box_F";

#ifndef __TT__
GVAR(rep_truck) = if (GVAR(enemy_side) == "OPFOR") then {GVAR(rep_truck_blufor)} else {GVAR(rep_truck_opfor)};
#endif

GVAR(version_string) =
#ifdef __OWN_SIDE_OPFOR__
	"Opfor";
#endif
#ifdef __OWN_SIDE_BLUFOR__
	"Blufor";
#endif
#ifdef __OWN_SIDE_INDEPENDENT__
	"Independent";
#endif
#ifdef __TT__
	"Two Teams";
#endif

// TODO: NO MGNESTS AT ALL IN A3  CURRENTLY, question is, will there ever be mg nests
if (GVAR(with_mgnest)) then {
	GVAR(mg_nest) = 
#ifdef __OWN_SIDE_INDEPENDENT__
	"Land_BagBunker_Small_F";
#endif
#ifdef __OWN_SIDE_OPFOR__
	"Land_BagBunker_Small_F";
#endif
#ifdef __OWN_SIDE_BLUFOR__
	"Land_BagBunker_Small_F";
#endif
#ifdef __TT__
	"";
#endif
};

GVAR(sm_bonus_vehicle_array) = (
#ifdef __DEFAULT__
	switch (GVAR(own_side)) do {
		// TODO: Keep INDEPENDENT ???
		case "INDEPENDENT": {["I_MRAP_03_hmg_F","I_MRAP_03_gmg_F"]};
		case "BLUFOR": {
			["B_MRAP_01_hmg_F","B_MRAP_01_gmg_F","B_Heli_Light_01_armed_F","B_Heli_Attack_01_F","B_APC_Wheeled_01_cannon_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F"]
		};
		case "OPFOR": {
			["O_MRAP_02_gmg_F","O_MRAP_02_hmg_F","O_APC_Wheeled_02_rcws_F","O_Heli_Attack_02_F","O_Heli_Light_02_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F"]
		};
	}
#endif
#ifdef __TT__
	[
		["A10_US_EP1","AH64D_EP1","AH6J_EP1","M1A1_US_DES_EP1","M1A2_US_TUSK_MG_EP1","M6_EP1"],
		["Su25_TK_EP1","L39_TK_EP1","Mi24_D_TK_EP1","T72_TK_EP1","T55_TK_EP1","ZSU_TK_EP1"]
	]
#endif
);

GVAR(mt_bonus_vehicle_array) =
#ifdef __DEFAULT__
switch (GVAR(own_side)) do {
	case "INDEPENDENT": {["BMP2_Gue","BRDM2_Gue","T34","HMMWV_M2","HMMWV_MK19","HMMWV_TOW","HMMWV_Avenger"]};
	case "BLUFOR": {
		["I_MRAP_03_hmg_F","I_MRAP_03_gmg_F","B_Heli_Light_01_armed_F","B_MRAP_01_hmg_F","B_MRAP_01_gmg_F","B_Heli_Attack_01_F","B_APC_Wheeled_01_cannon_F","I_MBT_03_cannon_F","I_APC_tracked_03_cannon_F"]
	};
	case "OPFOR": {
		["O_MRAP_02_gmg_F","O_MRAP_02_hmg_F","O_APC_Wheeled_02_rcws_F","O_Heli_Attack_02_F","O_Heli_Light_02_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F"]
	};
};
#endif
#ifdef __TT__
	[
		["M1126_ICV_M2_EP1","M1126_ICV_mk19_EP1","M1128_MGS_EP1","M1129_MC_EP1","M1135_ATGMV_EP1","M2A2_EP1","M2A3_EP1","HMMWV_M1151_M2_DES_EP1","HMMWV_M1151_M2_DES_EP1","HMMWV_M998_crows_M2_DES_EP1","HMMWV_M998_crows_MK19_DES_EP1","HMMWV_M998A2_SOV_DES_EP1","HMMWV_MK19_DES_EP1","HMMWV_TOW_DES_EP1","HMMWV_M1151_M2_CZ_DES_EP1","LandRover_Special_CZ_EP1"],
		["BMP2_TK_EP1","BRDM2_ATGM_TK_EP1","BRDM2_TK_EP1","BTR60_TK_EP1","M113_TK_EP1","LandRover_MG_TK_EP1","LandRover_SPG9_TK_EP1","UAZ_AGS30_TK_EP1","UAZ_MG_TK_EP1","Ural_ZU23_TK_EP1"]
	]
#endif

GVAR(x_drop_array) =
#ifdef __OWN_SIDE_INDEPENDENT__
	switch (true) do {
		default {
			[[(localize "STR_DOM_MISSIONSTRING_18"), "B_Mortar_01_F"], [(localize "STR_DOM_MISSIONSTRING_19"),"B_MRAP_01_F"], [(localize "STR_DOM_MISSIONSTRING_20"), "Box_NATO_Ammo_F"]]
		};
	};
#endif
#ifdef __OWN_SIDE_BLUFOR__
	switch (true) do {
		default {
			[[(localize "STR_DOM_MISSIONSTRING_18"), "B_Mortar_01_F"], [(localize "STR_DOM_MISSIONSTRING_19"),"B_MRAP_01_F"], [(localize "STR_DOM_MISSIONSTRING_20"), "Box_NATO_Ammo_F"]]
		};
	};
#endif
#ifdef __OWN_SIDE_OPFOR__
	switch (true) do {
		default {
			[[(localize "STR_DOM_MISSIONSTRING_18"), "O_Mortar_01_F"], [(localize "STR_DOM_MISSIONSTRING_22"),"O_MRAP_02_F"], [(localize "STR_DOM_MISSIONSTRING_20"), "Box_East_Ammo_F"]]
		};
	};
#endif
#ifdef __TT__
	[[(localize "STR_DOM_MISSIONSTRING_18"), "B_Mortar_01_F"], [(localize "STR_DOM_MISSIONSTRING_19"),"B_MRAP_01_F"], [(localize "STR_DOM_MISSIONSTRING_20"), "Box_NATO_Ammo_F"]];
#endif

// side of the pilot that will fly the drop air vehicle
GVAR(drop_side) = GVAR(own_side);

#ifndef __TT__
for "_i" from 0 to (count GVAR(sm_bonus_vehicle_array) - 1) do {
	GVAR(sm_bonus_vehicle_array) set [_i, toUpper(GVAR(sm_bonus_vehicle_array) select _i)];
};
for "_i" from 0 to (count GVAR(mt_bonus_vehicle_array) - 1) do {
	GVAR(mt_bonus_vehicle_array) set [_i, toUpper(GVAR(mt_bonus_vehicle_array) select _i)];
};
#else
for "_i" from 0 to (count (GVAR(sm_bonus_vehicle_array) select 0) - 1) do {
	(GVAR(sm_bonus_vehicle_array) select 0) set [_i, toUpper((GVAR(sm_bonus_vehicle_array) select 0) select _i)];
};
for "_i" from 0 to (count (GVAR(sm_bonus_vehicle_array) select 1) - 1) do {
	(GVAR(sm_bonus_vehicle_array) select 1) set [_i, toUpper((GVAR(sm_bonus_vehicle_array) select 1) select _i)];
};
for "_i" from 0 to (count (GVAR(mt_bonus_vehicle_array) select 0) - 1) do {
	(GVAR(mt_bonus_vehicle_array) select 0) set [_i, toUpper((GVAR(mt_bonus_vehicle_array) select 0) select _i)];
};
for "_i" from 0 to (count (GVAR(mt_bonus_vehicle_array) select 1) - 1) do {
	(GVAR(mt_bonus_vehicle_array) select 1) set [_i, toUpper((GVAR(mt_bonus_vehicle_array) select 1) select _i)];
};
#endif

// these vehicles can be lifted by the wreck lift chopper (previous chopper 4), but only, if they are completely destroyed
#ifndef __TT__
GVAR(heli_wreck_lift_types) = GVAR(sm_bonus_vehicle_array) + GVAR(mt_bonus_vehicle_array);
#else
GVAR(heli_wreck_lift_types) = (GVAR(sm_bonus_vehicle_array) select 0) + (GVAR(sm_bonus_vehicle_array) select 1) + (GVAR(mt_bonus_vehicle_array) select 0) + (GVAR(mt_bonus_vehicle_array) select 1);
#endif
{GVAR(heli_wreck_lift_types) set [_forEachIndex, toUpper _x]} forEach GVAR(heli_wreck_lift_types);

// internal
GVAR(next_jump_time) = -1;

// d_jumpflag_vec = empty ("") means normal jump flags for HALO jump get created
// if you add a vehicle typename to d_jumpflag_vec (d_jumpflag_vec = "B_Quadbike_01_F"; for example) only a vehicle gets created and no HALO jump is available
//TYRGHEN - the logic is changed, you can jump, teleport and create a quadbike
GVAR(jumpflag_vec) = 
#ifdef __OWN_SIDE_BLUFOR__
	"B_Quadbike_01_F";
#endif
#ifdef __OWN_SIDE_OPFOR__
	"O_Quadbike_01_F";
#endif
#ifdef __OWN_SIDE_INDEPENDENT__
	"B_Quadbike_01_F";
#endif

// internal
GVAR(sm_winner) = 0;
GVAR(objectID1) = objNull;
GVAR(objectID2) = objNull;

#ifndef __TT__
GVAR(player_entities) =  switch (true) do {
	default {
		["RESCUE","RESCUE2","alpha_1","alpha_2","alpha_3","alpha_4","alpha_5","alpha_6","alpha_7","alpha_8","bravo_1","bravo_2","bravo_3","bravo_4","bravo_5","bravo_6","bravo_7","bravo_8","charlie_1","charlie_2","charlie_3","charlie_4","charlie_5","charlie_6","charlie_7","charlie_8","delta_1","delta_2","delta_3","delta_4","delta_5","delta_6","echo_1","echo_2","echo_3","echo_4","echo_5","echo_6","echo_7","echo_8"]
	};
};
#else
GVAR(entities_tt_blufor) = ["RESCUE","blufor_1","blufor_2","blufor_3","blufor_4","blufor_5","blufor_6","blufor_7","blufor_8","blufor_9","blufor_10","blufor_11","blufor_12","blufor_13","blufor_14","blufor_15","blufor_16","blufor_17","blufor_18","blufor_19","blufor_20","blufor_21","blufor_22","blufor_23","blufor_24"];
GVAR(entities_tt_opfor) = ["RESCUE2","opfor_1","opfor_2","opfor_3","opfor_4","opfor_5","opfor_6","opfor_7","opfor_8","opfor_9","opfor_10","opfor_11","opfor_12","opfor_13","opfor_14","opfor_15","opfor_16","opfor_17","opfor_18","opfor_19","opfor_20","opfor_21","opfor_22","opfor_23","opfor_24"];
#endif

#ifdef __TT__
GVAR(tt_points) = [
	30, // points for the main target winner team
	7, // points if draw (main target)
	15, // points for destroying main target radio tower
	5, // points for main target mission
	10, // points for sidemission
	5, // points for capturing a camp (main target)
	10, // points that get subtracted when loosing a mt camp again
	4, // points for destroying a vehicle of the other team
	2 // points for killing a member of the other team
];
#endif

if (GVAR(sub_kill_points) != 0) then {
	GVAR(sub_kill_points) = GVAR(sub_kill_points) * -1;
};

GVAR(WarfareAircraftFactory_Opfor) = "Land_Cargo_House_V2_F";
GVAR(WarfareAircraftFactory_Blufor) = "Land_Cargo_House_V2_F";
GVAR(WarfareAircraftFactory_Independent) = "Land_Cargo_House_V2_F";


//GVAR(radio_tower) = "Land_TTowerBig_2_F";
GVAR(radio_tower) = ["Land_Communication_F","Land_Portable_generator_F","O_Truck_02_box_F"];

GVAR(wcamp) = "Land_Cargo_Patrol_V1_F";

GVAR(bigcontainer) = "B_Truck_01_box_F";//gits
GVAR(ProtectionZone) = "ProtectionZone_F";
GVAR(ProtectionZone_inv) = "ProtectionZone_Invisible_F";

GVAR(mash) = "MASH_EP1";

GVAR(dropped_box_marker) = "mil_marker";

// TYRGHEN
GVAR(strongpointmarker) = "mil_dot";
GVAR(towerpointmarker) = "mil_box";

GVAR(parachute_type) = "B_Parachute";
GVAR(trench_type) = "Land_BagFence_Short_F";

GVAR(base_aa_type) = "B_APC_Tracked_01_AA_F";

GVAR(sm_oldsm_idx) = 0;

GVAR(town_size_divider) = 200;

GVAR(flag_offset) = [0,0,1.8];
// End TYRGHEN

GVAR(SlopeObject) = "Logic" createVehicleLocal [0,0,0];

GVAR(mhq_vehicle_types) = ["B_MRAP_01_F","O_MRAP_02_F"];

if (isServer || {!isDedicated && {!hasInterface}}) then {
	GVAR(misc_stores) = GVAR(HeliHEmpty) createVehicleLocal [0,0,0];
	GVAR(player_store) = GVAR(HeliHEmpty) createVehicleLocal [0, 0, 0];
	GVAR(placed_objs_store) = GVAR(HeliHEmpty) createVehicleLocal [0, 0, 0];
	GVAR(placed_objs_store2) = GVAR(HeliHEmpty) createVehicleLocal [0, 0, 0];

	["OPFOR", opfor] call FUNC(StoreAdd);
	["BLUFOR", blufor] call FUNC(StoreAdd);
	["INDEPENDENT", independent] call FUNC(StoreAdd);
	["CIV", civilian] call FUNC(StoreAdd);

	["FOPFOR", "FlagCarrierTakistan_EP1"] call FUNC(StoreAdd);
	["FBLUFOR", "FlagCarrierUSA_EP1"] call FUNC(StoreAdd);
	["FINDEPENDENT", "FlagCarrierTKMilitia_EP1"] call FUNC(StoreAdd);
	
	if (isServer) then {
		if (GVAR(weather) == 0 && {GVAR(FastTime) == 0}) then {
			_overCast = random 1;
			#ifdef __DEBUG__
			_date = date;
			__TRACE_1("","_date");
			#endif
			/*if (isDedicated) then {
				skipTime -24;
				86400 setOvercast _overCast;
				skipTime 24;
			};*/
 			0 setOvercast _overCast;
			_ransecs = 1800 + random 600;
			GVAR(overcast) = [_overCast, _ransecs, time + _ransecs];

			publicVariable QGVAR(overcast);
			
			if (GVAR(with_fog) == 0) then {
				_fog = if (random 100 > 70) then {
					[random 0.1, 0.1, 20 + (random 40)]
				} else {
					[0,0.1,0]
				};
				if (isDedicated) then {
					0 setFog _fog;
				};
				GVAR(fog) = [_fog, 0];
				publicVariable QGVAR(fog);
			};
		} else {
			GVAR(weather) = 1;
			GVAR(overcast) = [0, 0];
			GVAR(fog) = [[0,0.1,0], 0];
			publicVariable QGVAR(fog);
		};
	};
	// _E = Opfor
	// _W = Blufor
	// _G = Independent
	// this is what gets spawned
	GVAR(allmen_E) =
	[
		["East","caf_ag_me_t","Infantry","10_men_me_t"] call FUNC(GetConfigGroup),
		["East","caf_ag_me_t","Infantry","8_men_me_t"] call FUNC(GetConfigGroup),
		["East","caf_ag_me_t","Infantry","6_men_me_t"] call FUNC(GetConfigGroup),
		["East","caf_ag_me_t","Infantry","4_men_me_t"] call FUNC(GetConfigGroup)
	];
	GVAR(allmen_W) = 
	[
		["West","BLU_F","Infantry","BUS_InfSquad"] call FUNC(GetConfigGroup),
		["West","BLU_F","Infantry","BUS_InfSquad_Weapons"] call FUNC(GetConfigGroup),
		["West","BLU_F","Infantry","BUS_InfTeam"] call FUNC(GetConfigGroup),
		["West","BLU_F","Infantry","BUS_InfTeam_AT"] call FUNC(GetConfigGroup),
		["West","BLU_F","Infantry","BUS_InfTeam_AA"] call FUNC(GetConfigGroup),
		["West","BLU_F","Infantry","BUS_ReconPatrol"] call FUNC(GetConfigGroup),
		["West","BLU_F","Infantry","BUS_SniperTeam"] call FUNC(GetConfigGroup),
		["West","BLU_F","Infantry","BUS_ReconTeam"] call FUNC(GetConfigGroup),
		["West","BLU_F","Support","BUS_Support_CLS"] call FUNC(GetConfigGroup),
		["West","BLU_F","Support","BUS_Support_EOD"] call FUNC(GetConfigGroup)
	];
	GVAR(allmen_G) =
	[
		["Indep","IND_F","Infantry","HAF_InfSquad"] call FUNC(GetConfigGroup),
		["Indep","IND_F","Infantry","HAF_InfSquad_Weapons"] call FUNC(GetConfigGroup),
		["Indep","IND_F","Infantry","HAF_InfTeam"] call FUNC(GetConfigGroup),
		["Indep","IND_F","Infantry","HAF_InfTeam_AT"] call FUNC(GetConfigGroup),
		["Indep","IND_F","Infantry","HAF_InfTeam_AA"] call FUNC(GetConfigGroup),
		["Indep","IND_F","Infantry","HAF_SniperTeam"] call FUNC(GetConfigGroup),
		["Indep","IND_F","Support","HAF_Support_CLS"] call FUNC(GetConfigGroup),
		["Indep","IND_F","Support","HAF_Support_EOD"] call FUNC(GetConfigGroup)
	];

	GVAR(specops_E) = ["East","caf_ag_me_t","Infantry","6_men_me_t"] call FUNC(GetConfigGroup);
	GVAR(specops_W) = ["West","BLU_F","Infantry","BUS_ReconTeam"] call FUNC(GetConfigGroup);
	GVAR(specops_G) = ["Indep","IND_F","Infantry","HAF_InfTeam"] call FUNC(GetConfigGroup);

	GVAR(sabotage_E) = ["CAF_AG_me_t_AK47"];
	GVAR(sabotage_W) = ["B_recon_exp_F"];
	GVAR(sabotage_G) = ["I_soldier_F"];

	// TYRGHEN
	// Only use those values if you want to spawn a different type of crew than the default vehicle crew. For exampe, to fill a BTR with insurgents
	GVAR(crew_override_E) = ["CAF_AG_me_t_AK47","CAF_AG_me_t_AK74"];
	GVAR(crew_override_W) = [];
	GVAR(crew_override_G) = [];
	// Same for pilots
	GVAR(pilot_override_E) = ["CAF_AG_me_t_AK47","CAF_AG_me_t_AK74"];
	GVAR(pilot_override_W) = [];
	GVAR(pilot_override_G) = [];
	
	GVAR(veh_a_E) = 
		[
			["O_APC_Tracked_02_cannon_F"],
			["CAF_AG_ME_T_Offroad_armed_01"],
			["CAF_AG_ME_T_Offroad_armed_01"],
			["CAF_AG_ME_T_Offroad_armed_01"],
			["CAF_AG_ME_T_Offroad_armed_01","CAF_AG_ME_T_van_01","CAF_AG_ME_T_Offroad"],
			["CAF_AG_ME_T_Offroad_armed_01"],
			["O_HMG_01_F","O_HMG_01_high_F"],
			["O_GMG_01_F","O_GMG_01_high_F"],
			["O_Mortar_01_F"],
			["O_Truck_02_fuel_F"],
			["O_Truck_02_box_F"],
			["O_Truck_02_Ammo_F"]
		];

	GVAR(veh_a_W) = 
		[
			["M1A2_US_TUSK_MG_EP1","M1A1_US_DES_EP1"],
			["M1126_ICV_M2_EP1","M1126_ICV_mk19_EP1","M1128_MGS_EP1","M1135_ATGMV_EP1"],
			["M2A2_EP1","M2A3_EP1"],
			["M6_EP1","HMMWV_Avenger_DES_EP1"],
			["HMMWV_M1151_M2_DES_EP1","HMMWV_M998_crows_M2_DES_EP1","HMMWV_M1151_M2_CZ_DES_EP1","LandRover_Special_CZ_EP1"],
			["HMMWV_M998_crows_MK19_DES_EP1","HMMWV_MK19_DES_EP1","HMMWV_TOW_DES_EP1"],
			["M2HD_mini_TriPod_US_EP1","M2StaticMG_US_EP1"],
			["M252_US_EP1","MK19_TriPod_US_EP1","Stinger_Pod_US_EP1","TOW_TriPod_US_EP1"],
			["M119_US_EP1","MLRS_DES_EP1"],
			["MtvrRefuel_DES_EP1"],
			["MtvrRepair_DES_EP1"],
			["MtvrReammo_DES_EP1"]
		];
	GVAR(veh_a_G) =
		[
			["I_MRAP_03_gmg_F"],//tank
			["I_MRAP_03_hmg_F"],//bmp
			["I_APC_Wheeled_03_cannon_F"],//brdm
			["I_MRAP_03_hmg_F"],//shilka
			["I_G_Offroad_01_armed_F"],//uaz mg
			["I_MRAP_03_F"],//uaz grenade
			["I_HMG_01_F"],//DSHKM
			["I_GMG_01_F"],//AGS
			["I_Mortar_01_F"],//D30
			["I_Truck_02_fuel_F"],//uralfuel
			["I_Truck_02_box_F"],//uralrep
			["I_Truck_02_ammo_F"]//uralammo
		];
	
	// first element (array. for example: [2,1]): number of vehicle groups that will get spawned, the first number is the max number that will get spawned,
	// the second one the minimum. So [2,0] means, there can be no vehicle groups at all or a maximum of 2 groups of this kind
	// second element: maximum number of vehicles in group; randomly chosen
	// TYRGHEN - Added Static MG and Launchers
	/*switch (GVAR(WithLessArmor)) do {
		case 0: {
			GVAR(vehicle_numbers_guard) = [
				[[1,0], 1], // tanks
				[[1,0], 1], // apc (bmp)
				[[1,1], 1], // apc2 (brdm)
				[[1,1], 1], // jeep with mg (uaz mg)
				[[1,0], 1] // jeep with gl (uaz grenade)
			];
			GVAR(vehicle_numbers_guard_static) = [
				[[1,1], 1], // tanks
				[[1,1], 1], // apc (bmp)
				[[1,1], 1], // aa (shilka)
				[[5,4], 1], // Static MG
				[[3,2], 1] // Static Launcher
			];
			GVAR(vehicle_numbers_patrol) = [
				[[1,1], 1], // tanks
				[[1,1], 1], // apc (bmp)
				[[1,1], 1], // apc2 (brdm)
				[[1,1], 1], // jeep with mg (uaz mg)
				[[1,1], 1] // jeep with gl (uaz grenade)
			];

			// allmost the same like above
			// first element the max number of ai "foot" groups that will get spawned, second element minimum number (no number for vehicles in group necessary)
			GVAR(footunits_guard) = [
	#ifndef __TT__
				[1,1], // basic groups
				[1,1] // specop groups
	#else
				[2,1], // basic groups
				[2,1] // specop groups
	#endif
			];
			GVAR(footunits_patrol) = [
				[5,3], // basic groups
				[5,3] // specop groups
			];
			GVAR(footunits_guard_static) = [
				[1,1], // basic groups
				[1,0] // specop groups
			];
			GVAR(footunits_attack) = [
				[1,1], // basic groups
				[1,1] // specop groups
			];
			GVAR(vehicle_numbers_attack) = [
				[[1,1], 1], // tanks
				[[1,1], 1], // apc (bmp)
				[[1,1], 1], // apc2 (brdm)
				[[1,1], 1], // jeep with mg (uaz mg)
				[[1,1], 1], // jeep with gl (uaz grenade)
				[[1,1], 1] // Shilka/AA
			];
		};
		case 1: {
			GVAR(vehicle_numbers_guard) = [
				[[0,0], 1], // tanks
				[[1,0], 1], // apc (bmp)
				[[1,0], 1], // apc2 (brdm)
				[[1,1], 1], // jeep with mg (uaz mg)
				[[1,1], 1] // jeep with gl (uaz grenade)
			];
			GVAR(vehicle_numbers_guard_static) = [
				[[0,0], 1], // tanks
				[[1,0], 1], // apc (bmp)
				[[1,0], 1], // aa (shilka)
				[[5,4], 1], // Static MG
				[[3,2], 1] // Static Launcher
			];
			GVAR(vehicle_numbers_patrol) = [
				[[0,0], 1], // tanks
				[[1,1], 1], // apc (bmp)
				[[1,0], 1], // apc2 (brdm)
				[[2,1], 1], // jeep with mg (uaz mg)
				[[1,1], 1] // jeep with gl (uaz grenade)
			];

			// allmost the same like above
			// first element the max number of ai "foot" groups that will get spawned, second element minimum number (no number for vehicles in group necessary)
			GVAR(footunits_guard) = [
	#ifndef __TT__
				[2,1], // basic groups
				[2,1] // specop groups
	#else
				[3,1], // basic groups
				[3,1] // specop groups
	#endif
			];
			GVAR(footunits_patrol) = [
				[6,3], // basic groups
				[6,3] // specop groups
			];
			GVAR(footunits_guard_static) = [
				[3,1], // basic groups
				[2,1] // specop groups
			];
			GVAR(footunits_attack) = [
				[3,1], // basic groups
				[2,1] // specop groups
			];
			GVAR(vehicle_numbers_attack) = [
				[[0,0], 1], // tanks
				[[1,0], 1], // apc (bmp)
				[[1,0], 1], // apc2 (brdm)
				[[1,1], 1], // jeep with mg (uaz mg)
				[[1,1], 1], // jeep with gl (uaz grenade)
				[[0,0], 1] // Shilka/AA
			];
		};
		case 2: {
			GVAR(vehicle_numbers_guard) = [
				[[0,0], 1], // tanks
				[[0,0], 1], // apc (bmp)
				[[0,0], 1], // apc2 (brdm)
				[[2,1], 1], // jeep with mg (uaz mg)
				[[2,1], 1] // jeep with gl (uaz grenade)
			];
			GVAR(vehicle_numbers_guard_static) = [
				[[0,0], 1], // tanks
				[[0,0], 1], // apc (bmp)
				[[0,0], 1], // aa (shilka)
				[[5,4], 1], // Static MG
				[[3,2], 1] // Static Launcher
			];
			GVAR(vehicle_numbers_patrol) = [
				[[0,0], 1], // tanks
				[[0,0], 1], // apc (bmp)
				[[0,0], 1], // apc2 (brdm)
				[[2,1], 1], // jeep with mg (uaz mg)
				[[2,1], 1] // jeep with gl (uaz grenade)
			];

			// allmost the same like above
			// first element the max number of ai "foot" groups that will get spawned, second element minimum number (no number for vehicles in group necessary)
			GVAR(footunits_guard) = [
	#ifndef __TT__
				[4,1], // basic groups
				[4,1] // specop groups
	#else
				[4,1], // basic groups
				[4,1] // specop groups
	#endif
			];
			GVAR(footunits_patrol) = [
				[8,3], // basic groups
				[6,3] // specop groups
			];
			GVAR(footunits_guard_static) = [
				[4,1], // basic groups
				[3,1] // specop groups
			];
			GVAR(footunits_attack) = [
				[6,1], // basic groups
				[6,1] // specop groups
			];
			GVAR(vehicle_numbers_attack) = [
				[[0,0], 1], // tanks
				[[0,0], 1], // apc (bmp)
				[[0,0], 1], // apc2 (brdm)
				[[2,1], 1], // jeep with mg (uaz mg)
				[[2,1], 1], // jeep with gl (uaz grenade)
				[[1,0], 1] // Shilka/AA
			];
		};
	};*/

	GVAR(arti_observer_E) = "O_spotter_F";
	GVAR(arti_observer_W) = "B_recon_JTAC_F";
	GVAR(arti_observer_G) = "TK_GUE_Soldier_AR_EP1";
	
	GVAR(number_attack_planes) = 1;
	GVAR(number_attack_choppers) = 1;
	
	// enemy ai skill: [base skill, random value (random 0.3) that gets added to the base skill]
	/*GVAR(skill_array) = switch (GVAR(EnemySkill)) do {
		case 1: {[0.2,0.2]};
		case 2: {[0.4,0.3]};
		case 3: {[0.7,0.3]};
	};*/
	
	
	// Type of aircraft, that will air drop stuff
	GVAR(drop_aircraft) =
	#ifdef __OWN_SIDE_INDEPENDENT__
		"I_Heli_Transport_02_F";
	#endif
	#ifdef __OWN_SIDE_BLUFOR__
		"I_Heli_Transport_02_F";
	#endif
	#ifdef __OWN_SIDE_OPFOR__
		"O_Heli_Light_02_unarmed_F";
	#endif
	#ifdef __TT__
		"B_Heli_Transport_01_camo_F";
	#endif
		
	if (GVAR(with_ai) || {GVAR(with_ai_features) == 0}) then {
	GVAR(taxi_aircraft) =
	#ifdef __OWN_SIDE_INDEPENDENT__
		"I_Heli_Transport_02_F";
	#endif
	#ifdef __OWN_SIDE_BLUFOR__
		"B_Heli_Transport_01_camo_F";
	#endif
	#ifdef __OWN_SIDE_OPFOR__
		"O_Heli_Light_02_unarmed_F";
	#endif
	#ifdef __TT__
		"B_Heli_Transport_01_camo_F";
	#endif
	};

	// max men for main target clear
	GVAR(man_count_for_target_clear) = 6;
	// max tanks for main target clear
	GVAR(tank_count_for_target_clear) = 0;
	// max cars for main target clear
	GVAR(car_count_for_target_clear) = 0;
	
	/*#ifndef __TT__
	// if set to true no enemy AI will attack base and destroy bonus vehicles or whatever
	GVAR(no_sabotage) = (GVAR(WithBaseAttack) == 1);
	#endif*/
	
	// time (in sec) between attack planes and choppers over main target will respawn once they were shot down (a random value between 0 and 240 will be added)
	GVAR(airki_respawntime) = 1200;

	GVAR(side_missions_random) = [];

	#ifndef __TT__
	// don't remove GVAR(recapture_indices) even if you set GVAR(WithRecapture) to 1
	GVAR(recapture_indices) = [];

	// max number of cities that the enemy will recapture at once
	// if set to -1 no check is done
	GVAR(max_recaptures) = 2;
	#endif
	
	GVAR(time_until_next_sidemission) = [
		[10,300], // if player number <= 10, it'll take 300 seconds = 5 minutes until the next sidemission
		[20,600], // if player number <= 20, it'll take 600 seconds = 10 minutes until the next sidemission
		[30,900], // if player number <= 30, it'll take 900 seconds = 15 minutes until the next sidemission
		[40,1200] // if player number <= 40, it'll take 1200 seconds = 20 minutes until the next sidemission
	];

	GVAR(civilians_t) = ["C_man_1","C_man_1_1_F","C_man_1_2_F","C_man_1_3_F","C_man_polo_1_F","C_man_polo_2_F","C_man_polo_3_F","C_man_polo_4_F","C_man_polo_5_F","C_man_polo_6_F"];
	
	GVAR(banti_airdown) = false;

	GVAR(wreck_cur_ar) = [];
	
	GVAR(illum_tower) = "Land_TTowerBig_2_F";
	GVAR(sm_fortress) = "Land_Cargo_House_V2_F";
	GVAR(functionary) = "C_man_polo_4_F"; // TODO, just simple civilians in A3
	GVAR(fuel_station) = "Land_FuelStation_Build_F";
	GVAR(cruise_missile) = "Chukar_EP1";
	GVAR(sm_cargo) = "B_supplyCrate_F";
	GVAR(sm_hangar) = "Land_TentHangar_V1_F";
	GVAR(sm_hangar2) = "Land_Hangar_F";
	GVAR(sm_tent) = "Land_TentA_F";

	GVAR(sm_SCUD) = "MAZ_543_SCUD_TK_EP1";
	GVAR(sm_simple_soldier_opfor) = "O_G_Soldier_Lite_F";
	GVAR(sm_land_tankbig) = "Land_dp_bigTank_F";
	GVAR(sm_land_oilpump) = "Land_Ind_Oil_Pump_EP1";
	GVAR(sm_land_misc_cargo2e) = "Box_East_AmmoVeh_F";
	GVAR(sm_land_transformer) = "Land_dp_transformer_F";
	GVAR(sm_barracks) = "Land_i_Barracks_V2_F";
	GVAR(sm_land_tanksmall) = "Land_dp_smallTank_F";
	GVAR(sm_land_factory) = "Land_dp_smallFactory_F";
	GVAR(sm_small_radar) = "Land_Radar_Small_F";
	GVAR(sm_chem_truck) = "O_G_Van_01_fuel_F";
	GVAR(sm_cargo_truck) = "O_Truck_02_covered_F";

	GVAR(soldier_officer) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_officer_F"};
		case "BLUFOR": {"B_officer_F"};
		case "INDEPENDENT": {"I_officer_F"};
	};
	GVAR(SBcrew) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_crew_F"};
		case "BLUFOR": {"B_crew_F"};
		case "INDEPENDENT": {"I_crew_F"};
	};
	GVAR(soldier_officer2) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_officer_F"};
		case "BLUFOR": {"B_officer_F"};
		case "INDEPENDENT": {"I_recon_TL_F"};
	};
	GVAR(sniper) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_sniper_F"};
		case "BLUFOR": {"B_sniper_F"};
		case "INDEPENDENT": {"I_sniper_F"};
	};
	GVAR(sm_arty) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_Mortar_01_F"};
		case "BLUFOR": {"B_Mortar_01_F"};
		case "INDEPENDENT": {"I_Mortar_01_F"};
	};
	// TYRGHEN
	GVAR(sm_arty_vec) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_MBT_02_arty_F"};
		case "BLUFOR": {"B_MBT_01_arty_F"};
		case "INDEPENDENT": {"I_Mortar_01_F"};
	};
	GVAR(sm_plane) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"I_Plane_Fighter_03_AA_F"};
		case "BLUFOR": {"B_Plane_CAS_01_F"};
		case "INDEPENDENT": {"I_Plane_Fighter_03_AA_F"};
	};
	GVAR(sm_tank) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"0_APC_Tracked_02_cannon_F"};
		case "BLUFOR": {"B_MBT_01_cannon_F"};
		case "INDEPENDENT": {"I_APC_Tracked_03_cannon_F"};
	};
	GVAR(sm_apc) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_APC_Wheeled_02_rcws_F"};
		case "BLUFOR": {"B_APC_Wheeled_01_cannon_F"};
		case "INDEPENDENT": {"I_APC_Wheeled_03_cannon_F"};
	};
	GVAR(sm_HunterGMG) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_MRAP_02_gmg_F"};
		case "BLUFOR": {"B_MRAP_01_gmg_F"};
		case "INDEPENDENT": {"I_MRAP_03_hmg_F"};
	};
	GVAR(sm_SpeedBoat) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_Boat_Armed_01_hmg_F"};
		case "BLUFOR": {"B_Boat_Armed_01_hmg_F"};
		case "INDEPENDENT": {"I_Boat_Armed_01_hmg_F"};
	};
	GVAR(sm_submarine) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_SDV_01_F"};
		case "BLUFOR": {"B_SDV_01_F"};
		case "INDEPENDENT": {"I_SDV_01_F"};
	};
	GVAR(sm_AssaultBoat) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_Boat_Transport_01_F"};
		case "BLUFOR": {"B_Boat_Transport_01_F"};
		case "INDEPENDENT": {"I_Boat_Transport_01_F"};
	};
	GVAR(sm_chopper) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_Heli_Light_02_F"};
		case "BLUFOR": {"B_Heli_Attack_01_F"};
		case "INDEPENDENT": {"I_Heli_Transport_02_F"};
	};
	GVAR(sm_pilottype) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"B_Helipilot_F"};
		case "BLUFOR": {"O_helipilot_F"};
		case "INDEPENDENT": {"I_helipilot_F"};
	};
	GVAR(sm_wrecktype) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"Land_Wreck_Heli_Attack_01_F"};
		case "BLUFOR": {"Land_UWreck_Heli_Attack_02_F"};
		case "INDEPENDENT": {"Land_Wreck_Heli_Attack_01_F"};
	};
	GVAR(sm_ammotrucktype) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_Truck_02_Ammo_F"};
		case "BLUFOR": {"B_Truck_01_ammo_F"};
		case "INDEPENDENT": {"I_Truck_02_ammo_F"};
	};
	// TYRGHEN
	GVAR(sm_fueltrucktype) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"O_Truck_02_fuel_F"};
		case "BLUFOR": {"B_Truck_01_fuel_F"};
		case "INDEPENDENT": {"I_Truck_02_fuel_F"};
	};
	// TYRGHEN
	GVAR(sm_fireplace) = "FirePlace_burning_F";
	
	#ifndef __TT__
	GVAR(intel_unit) = objNull;
	#endif

	#ifdef __TT__
	GVAR(sm_arty_crewman) = "I_Soldier_A_F";
	#endif

	GVAR(enemyai_mt_start_pos) = [];
	
	GVAR(ArtyShellsBlufor) = [
		"8Rnd_82mm_Mo_Flare_white", //flare
		"8Rnd_82mm_Mo_shells", // HE
		"8Rnd_82mm_Mo_Smoke_white", // Smoke
		"G_40mm_HE", // dpicm
		"Sh_155mm_AMOS" // SADARM
		// TODO SADARM
	];

	GVAR(ArtyShellsOpfor) = [
		"8Rnd_82mm_Mo_Flare_white", //flare
		"8Rnd_82mm_Mo_shells", // HE
		"8Rnd_82mm_Mo_Smoke_white", // Smoke
		"G_40mm_HE", // dpicm
		"Sh_155mm_AMOS" // SADARM
		// TODO SADARM
	];

	GVAR(LandMines) = [
		"APERSBoundingMine",
		"APERSTripMine"
	];

	GVAR(ClamShell) = "76n6ClamShell_EP1";
	GVAR(baseAARadarUS) = "Land_Radar_Small_F";
	GVAR(baseAARadarOpfor) = "Land_Radar_Small_F";

	GVAR(base_aavecs_check) = ["B_APC_TRACKED_01_AA_F", "O_APC_TRACKED_02_AA_F"]; // toupper!

	GVAR(all_simulation_stoped) = false;

	GVAR(hd_sim_types) = ["SHOTPIPEBOMB", "SHOTTIMEBOMB", "SHOTDIRECTIONALBOMB","SHOTMINE"]; // uppercase!

	// blufor, opfor
	GVAR(vec_spawn_default_Crew) = ["B_crew_F", "O_crew_F"];

	GVAR(isle_defense_marker) = "n_mech_inf";

	// Some inf groups are reduced if no players are near them.
	// Here you can set the distance to a player unit.
	GVAR(reduce_distance) = 1200;
	
	GVAR(firebase) = if (GVAR(enemy_side) == "OPFOR") then {
		[
			// Type, Relative pos to first element, angle to add, Spawn as crewed Vehicle
			["Land_HelipadEmpty_F",[0,0,0],0,false],
			["O_Mortar_01_F",[0,3.7,0],0,true],
			["O_Mortar_01_F",[0,0,0],0,true],
			["O_Mortar_01_F",[0,-3.7,0],0,true],
			["O_HMG_01_high_F",[6,0,0],0,true],
			["Land_HBarrier_3_F",[3,0,0],-90,false],
			["Land_HBarrier_3_F",[-3.5,0,0],90,false],
			["Land_HBarrier_3_F",[3,3.5,0],-90,false],
			["Land_HBarrier_3_F",[-3.5,3,0],90,false],
			["Land_HBarrier_3_F",[3,-3,0],-90,false],
			["Land_HBarrier_3_F",[-3.5,-3.5,0],90,false],
			["Land_HBarrier_Big_F",[0.5,8,0],180,false],
			["Land_HBarrier_Big_F",[0.5,-8,0],0,false],
			["Box_East_AmmoVeh_F",[5,5,0],0,false],
			["O_Truck_02_Ammo_F",[-6.8,-5,0],155,false],
			["Land_MetalBarrel_F",[5,-5,0],0,false],
			["Land_MetalBarrel_F",[5,-5.5,0],0,false]
		]
	} else {
		[
			// Type, Relative pos to first element, Spawn as crewed Vehicle
			["Land_HelipadEmpty_F",[0,0,0],false],
			["B_Mortar_01_F",[0,0,0],true],
			["B_Mortar_01_F",[0,0,0],0,true],
			["B_Mortar_01_F",[0,-3,0],0,true],
			["B_HMG_01_high_F",[6,0,0],0,true],
			["Land_HBarrier_3_F",[3.5,0,0],-90,false],
			["Land_HBarrier_3_F",[-2.5,0,0],90,false],
			["Land_HBarrier_3_F",[3.5,3,0],-90,false],
			["Land_HBarrier_3_F",[-2.5,3,0],90,false],
			["Land_HBarrier_3_F",[3.5,-3,0],-90,false],
			["Land_HBarrier_3_F",[-2.5,-3,0],90,false],
			["Land_HBarrier_3_F",[0.5,6.5,0],180,false],
			["Land_HBarrier_3_F",[0.5,-6.5,0],0,false],
			["Box_East_AmmoVeh_F",[5,5,0],0,false],
			["O_Truck_02_Ammo_F",[-6.8,-5,0],155,false],
			["Land_MetalBarrel_F",[5,-5,0],0,false],
			["Land_MetalBarrel_F",[5,-5.5,0],0,false]
		]
	};

	GVAR(artillery_radar) = switch (GVAR(enemy_side)) do {
		case "BLUFOR": {"US_WarfareBArtilleryRadar_EP1"};
		case "OPFOR": {"TK_WarfareBArtilleryRadar_EP1"};
		case "INDEPENDENT": {"TK_GUE_WarfareBArtilleryRadar_EP1"};
	};

	GVAR(air_radar) = switch (GVAR(enemy_side)) do {
		case "BLUFOR": {"Land_Radar_Small_F"};
		case "OPFOR": {"Land_Radar_Small_F"};
		case "INDEPENDENT": {"Land_Radar_Small_F"};
	};

	GVAR(enemy_hq) = switch (GVAR(enemy_side)) do {
		case "OPFOR": {"Land_Cargo_HQ_V1_F"}; // TODO
		case "BLUFOR": {"Land_Cargo_HQ_V1_F"};
		case "INDEPENDENT": {"Land_Cargo_HQ_V1_F"};
	};

	// type of enemy plane that will fly over the main target
	GVAR(airki_attack_plane) = switch (true) do {
		default {
			switch (GVAR(enemy_side)) do {
				case "OPFOR": {["O_Heli_Light_02_F"]};
				case "BLUFOR": {["B_Heli_Attack_01_F","B_Heli_Light_01_armed_F"]};
				case "INDEPENDENT": {["I_Plane_Fighter_03_AA_F","I_Plane_Fighter_03_CAS_F"]};
				default {[]};
			};
		};
	};

	// type of enemy chopper that will fly over the main target
	GVAR(airki_attack_chopper) = switch (true) do {
		default {
			switch (GVAR(enemy_side)) do {
				case "OPFOR": {["O_Heli_Light_02_F"]};
				case "BLUFOR": {["B_Heli_Attack_01_F","B_Heli_Light_01_armed_F"]};
				case "INDEPENDENT": {["B_Heli_Light_01_armed_F"]};
				default {[]};
			};
		};
	};

	// enemy parachute troops transport chopper
	GVAR(transport_chopper) = switch (true) do {
		default {
			switch (GVAR(enemy_side)) do {
				case "OPFOR": {["O_Heli_Light_02_unarmed_F"]};
				case "BLUFOR": {["B_Heli_Transport_01_F"]};
				case "INDEPENDENT": {["I_Heli_Transport_02_F"]};
			};
		};
	};

	// light attack chopper (for example Mi17 with MG)
	GVAR(light_attack_chopper) = switch (true) do {
		default {
			switch (GVAR(enemy_side)) do {
				case "OPFOR": {["O_Heli_Light_02_F"]};
				case "BLUFOR": {["B_Heli_Light_01_armed_F"]};
				case "INDEPENDENT": {["B_Heli_Light_01_armed_F"]};
				default {[]};
			};
		};
	};
};
GVAR(uids_for_reserved_slots) = [];

if (!isDedicated) then {
	// GVAR(reserved_slot) gives you the ability to add a reserved slot for admins
	// if you don't log in when you've chosen the slot, you'll get kicked after ~20 once the intro ended
	// default is no check, example: GVAR(reserved_slot) = "RESCUE";
	GVAR(reserved_slot) = "";

	// GVAR(uid_reserved_slots) and GVAR(uids_for_reserved_slots) gives you the possibility to limit a slot
	// you have to add the var names of the units to GVAR(uid_reserved_slots) and in GVAR(uids_for_reserved_slots) the UIDs of valid players
	// GVAR(uid_reserved_slots) = ["alpha_1", "bravo_3"];
	// GVAR(uids_for_reserved_slots) = ["1234567", "7654321"];
	// TYRGHEN
	GVAR(uid_reserved_slots) = ["echo_1","echo_2","echo_3","echo_4","echo_5","echo_6","echo_7","echo_8"];
	GVAR(uids_for_reserved_slots) = [];

	// marker type used for players
	GVAR(p_marker) = (getArray (missionConfigFile/"Params"/QGVAR(MarkerTypeL)/"texts")) select GVAR(MarkerTypeL);
	
	// this vehicle will be created if you use the "Create XXX" at a mobile respawn (old "Create Motorcycle") or at a jump flag
	// IMPORTANT !!!! for ranked version !!!!
	// if there is more than one vehicle defined in the array the vehicle will be selected by player rank
	// one vehicle only, vehicle is only available when the player is at least lieutenant
	GVAR(create_bike) =
	#ifdef __OWN_SIDE_INDEPENDENT__
	["I_Quadbike_01_F","I_Boat_Transport_01_F"];
	#endif
	#ifdef __OWN_SIDE_BLUFOR__
	["B_Quadbike_01_F","B_Boat_Transport_01_F"];
	#endif
	#ifdef __OWN_SIDE_OPFOR__
	["O_Quadbike_01_F","O_Boat_Transport_01_F"];
	#endif
	#ifdef __TT__
	[];
	#endif
	
	GVAR(UAV_Small) = "";
	GVAR(UAV_Terminal) = "";
	#ifdef __OWN_SIDE_BLUFOR__
	GVAR(UAV_Small) = "B_UAV_01_F";
	GVAR(UAV_Terminal) = "B_UavTerminal";
	#endif
	#ifdef __OWN_SIDE_OPFOR__
	GVAR(UAV_Small) = "O_UAV_01_F";
	GVAR(UAV_Terminal) = "O_UavTerminal";
	#endif
	#ifdef __OWN_SIDE_INDEPENDENT__
	GVAR(UAV_Small) = "I_UAV_01_F";
	GVAR(UAV_Terminal) = "I_UavTerminal";
	#endif

	GVAR(cur_sm_txt) = "";
	GVAR(current_mission_resolved_text) = "";

	// time player has to wait until he can drop the next ammobox (old ammobox handling)
	// in the new ammobox handling (default, loading and dropping boxes) it means the time dif in seconds before a box can be loaded or dropped again in a vehicle
	GVAR(drop_ammobox_time) = GVAR(MHQBoxWaitTime);
	GVAR(current_truck_cargo_array) = 0;
	// GVAR(check_ammo_load_vecs)
	// the only vehicles that can load an ammo box are the transport choppers and MHQs__
	#ifdef __OWN_SIDE_BLUFOR__
	//TYRGHEN - added other vehicles
	GVAR(check_ammo_load_vecs) =  ["B_Heli_Light_01_armed_F","B_MRAP_01_F","B_MRAP_01_gmg_F","B_MRAP_01_hmg_F","B_Heli_Light_01_F","B_Heli_Transport_01_F","B_APC_Wheeled_01_cannon_F"];
	#endif
	#ifdef __OWN_SIDE_OPFOR__
	GVAR(check_ammo_load_vecs) = ["O_MRAP_02_F","O_MRAP_02_hmg_F","O_MRAP_02_gmg_F","O_APC_Wheeled_02_rcws_F","O_Heli_Light_02_unarmed_F"];
	#endif
	#ifdef __OWN_SIDE_INDEPENDENT__
	GVAR(check_ammo_load_vecs) = ["I_MRAP_03_F","I_MRAP_03_hmg_F","I_MRAP_03_gmg_F","I_APC_Wheeled_03_cannon_F","I_Heli_Transport_02_F"];
	#endif
	#ifdef __TT__
	GVAR(check_ammo_load_vecs) = ["B_Heli_Light_01_armed_F","B_MRAP_01_F","B_MRAP_01_gmg_F","B_MRAP_01_hmg_F","B_Heli_Light_01_F","B_Heli_Transport_01_F","B_APC_Wheeled_01_cannon_F"
								 ,"O_MRAP_02_F","O_MRAP_02_hmg_F","O_MRAP_02_gmg_F","O_APC_Wheeled_02_rcws_F","O_Heli_Light_02_unarmed_F"];
	#endif

	GVAR(weapon_respawn) = true;

	/*if (GVAR(with_ai)) then {
		GVAR(current_ai_num) = 0;
	};*/

	// points needed to get a specific rank
	// gets even used in the unranked versions, though it's just cosmetic there
	#ifndef __TT__
	GVAR(points_needed) = [
		20, // Corporal
		50, // Sergeant
		80, // Lieutenant
		130, // Captain
		180, // Major
		250 // Colonel
	];
	#else
	GVAR(points_needed) = [
		50, // Corporal
		150, // Sergeant
		300, // Lieutenant
		500, // Captain
		750, // Major
		1200 // Colonel
	];
	#endif

	/*if (GVAR(with_ranked)) then {
		GVAR(ranked_a) = [
			20, // points that an engineer must have to repair/refuel a vehicle
			[3,2,1,0], // points engineers get for repairing an air vehicle, tank, car, other
	#ifndef __TT__
			10, // points an artillery operator needs for a strike
	#else
			1,
	#endif
			3, // points in the AI version for recruiting one soldier
			10, // points a player needs for an AAHALO parajump
	#ifndef __TT__
			10, // points that get subtracted for creating a vehicle at a MHQ
	#else
			1,
	#endif
			20, // points needed to create a vehicle at a MHQ
			3, // points a medic gets if someone heals at his Mash
			["Sergeant","Lieutenant","Captain","Major"], // Ranks needed to drive different vehicles, starting with: kindof wheeled APC, kindof Tank, kindof Helicopter (except the inital 4 helis), Plane
			30, // points that get added if a player is xxx m in range of a main target when it gets cleared
			400, // range the player has to be in to get the main target extra points
			10, // points that get added if a player is xxx m in range of a sidemission when the sidemission is resolved
			200, // range the player has to be in to get the sidemission extra points
			20, // points needed for an egineer to rebuild the support buildings at base
			10, // points needed to build a mg nest
			5, // points needed in AI Ranked to call in an airtaxi
			20, // points needed to call in an air drop
			4, // points a medic gets when he heals another unit
			1, // points that a player gets when transporting others
			20, // points needed for activating satellite view
			20, // points needed to build a FARP (engineer)
			2 // points a player gets for reviving another player
		];

		// distance a player has to transport others to get points
		GVAR(transport_distance) = 500;

		// rank needed to fly the wreck lift chopper
		GVAR(wreck_lift_rank) = "CAPTAIN";
	} else {
		GVAR(ranked_a) = [];
	};*/

	//GVAR(graslayer_index) = if (GVAR(GrasAtStart) == 1) then {0} else {1};

	GVAR(custom_layout) = [];

	//GVAR(disable_viewdistance) = (GVAR(ViewdistanceChange) == 1);

	if (GVAR(LimitedWeapons)) then {
	_standard_weap = ["M16A2","M4A1","G36A_camo","G36C_camo","G36K_camo","LeeEnfield","M14_EP1","AKS_74_kobra","AK_47_M","AK_47_S","AK_74","AKS_74","AKS_74_kobra","AKS_74_U","FN_FAL","Sa58P_EP1","Sa58V_EP1","SCAR_L_CQC","SCAR_L_CQC_Holo","SCAR_L_STD_HOLO"];
	_silenced = ["SCAR_H_CQC_CCO_SD","SCAR_H_STD_TWS_SD"];
	_glweaps = ["AK_74_GL","AK_74_GL_kobra","M16A2GL","M4A3_RCO_GL_EP1","SCAR_H_STD_EGLM_Spect","SCAR_L_CQC_EGLM_Holo","SCAR_L_STD_EGLM_RCO","SCAR_L_STD_EGLM_TWS","M32_EP1","M79_EP1","Mk13_EP1"];
	_basic = ["M16A2","M4A1","AK_47_M","AK_47_S","AK_74","M14_EP1","LeeEnfield","AKS_74","FN_FAL","Sa58P_EP1","Sa58V_EP1"];
	_machineg = ["m240_scoped_EP1","M249_EP1","M249_m145_EP1","M249_TWS_EP1","M60A4_EP1","MG36_camo","Mk_48_DES_EP1","PK","RPK_74"];
	_sniper = ["KSVK","M107","M107 TWS","M110_NVG_EP1","M110_TWS_EP1","M24_des_EP1","SCAR_H_LNG_Sniper","SCAR_H_LNG_Sniper_SD","SVD","SVD_des_EP1","SVD_NSPU_EP1"];
	_atweap = ["Javelin","M136","M47Launcher_EP1","MAAWS","MetisLauncher","RPG18","RPG7V"];
	GVAR(limited_weapons_ar) = [
		[["delta_1","delta_2","delta_3","delta_4","delta_5","delta_6"], _standard_weap],
		[["RESCUE","RESCUE2"], _standard_weap],
		[["bravo_1","alpha_1","charlie_1","echo_1"], _standard_weap + _silenced],
		[["alpha_5","bravo_3","bravo_7"], _standard_weap + _glweaps],
		[["alpha_3","alpha_7","charlie_7","charlie_3","bravo_4"], _basic + _machineg],
		[["alpha_2","bravo_5","charlie_2"], _basic + _sniper],
		[["alpha_6","bravo_6","charlie_6"], _basic],
		[["alpha_4","alpha_8","charlie_4","charlie_8"], _standard_weap + _atweap],
		[[], _standard_weap]
	];
	};

	GVAR(marker_vecs) = [];

	// chopper varname, type (0 = lift chopper, 1 = wreck lift chopper, 2 = normal chopper), marker name, unique number (same as in d_init.sqf), marker type, marker color, marker text, chopper string name
	#ifdef __TT__
	GVAR(choppers_blufor) = [
		["HR1",0,"chopper1",3001,"n_air","ColorWhite","1",(localize "STR_DOM_MISSIONSTRING_7")], ["HR2",0,"chopper2",3002,"n_air","ColorWhite","2",(localize "STR_DOM_MISSIONSTRING_8")],
		["HR3",0,"chopper3",3003,"n_air","ColorWhite","3",(localize "STR_DOM_MISSIONSTRING_9")], ["HR4",1,"chopper4",3004,"n_air","ColorWhite","W",(localize "STR_DOM_MISSIONSTRING_10")],
		["HR5",2,"chopper5",3005,"n_air","ColorWhite","5",(localize "STR_DOM_MISSIONSTRING_11")], ["HR6",2,"chopper6",3006,"n_air","ColorWhite","6",(localize "STR_DOM_MISSIONSTRING_11")]
	];
	GVAR(choppers_blufor) = [
		["HRR1",0,"chopperR1",4001,"n_air","ColorWhite","1",(localize "STR_DOM_MISSIONSTRING_7")], ["HRR2",0,"chopperR2",4002,"n_air","ColorWhite","2",(localize "STR_DOM_MISSIONSTRING_8")],
		["HRR3",0,"chopperR3",4003,"n_air","ColorWhite","3",(localize "STR_DOM_MISSIONSTRING_9")], ["HRR4",1,"chopperR4",4004,"n_air","ColorWhite","W",(localize "STR_DOM_MISSIONSTRING_10")],
		["HRR5",2,"chopperR5",4005,"n_air","ColorWhite","5",(localize "STR_DOM_MISSIONSTRING_11")], ["HRR6",2,"chopperR6",4006,"n_air","ColorWhite","6",(localize "STR_DOM_MISSIONSTRING_11")]
	];
	#else
	GVAR(choppers) = [
		["HR1",0,"chopper1",3001,"n_air","ColorWhite","L1",(localize "STR_DOM_MISSIONSTRING_7")], ["HR2",0,"chopper2",3002,"n_air","ColorWhite","L2",(localize "STR_DOM_MISSIONSTRING_8")],
		["HR3",0,"chopper3",3003,"n_air","ColorWhite","L3",(localize "STR_DOM_MISSIONSTRING_9")], ["HR4",1,"chopper4",3004,"n_air","ColorWhite","CW",(localize "STR_DOM_MISSIONSTRING_10")],
		["HR5",2,"chopper5",3005,"n_air","ColorWhite","C5",""], ["HR6",2,"chopper6",3006,"n_air","ColorWhite","C6",""],
		// TYRGHEN
		["VC1",2,"chopper7",3007,"n_air","ColorGreen","WY55",""], ["VC2",0,"chopper8",3008,"n_air","ColorGreen","CH49",""], ["VC3",0,"chopper9",3009,"n_air","ColorGreen","UH80",""]
	];
	#endif

	// vehicle varname, unique number (same as in d_init.sqf), marker name, marker type, marker color, marker text, vehicle string name
	#ifndef __TT__
	GVAR(p_vecs) = [
		["MRR1",0,"mobilerespawn1","b_hq","ColorYellow","MHQ1",(localize "STR_DOM_MISSIONSTRING_12")],["MRR2",1,"mobilerespawn2","b_hq","ColorYellow","MHQ2",(localize "STR_DOM_MISSIONSTRING_13")],
		["MEDVEC",100,"medvec","n_med","ColorGreen","M",""],["TR1",200,"truck1","n_maint","ColorGreen","R1",""],
		["TR2",201,"truck2","n_support","ColorGreen","F1",""],["TR3",202,"truck3","n_support","ColorGreen","A1",""],
		["TR6",203,"truck4","n_maint","ColorGreen","R2",""],["TR5",204,"truck5","n_support","ColorGreen","F2",""],
		["TR4",205,"truck6","n_support","ColorGreen","A2",""],["TR7",300,"truck7","n_service","ColorGreen","E1",""],
		["TR8",301,"truck8","n_service","ColorGreen","E2",""],
		// TYRGHEN
		["VT1",400,"truck9","b_motor_inf","ColorGreen","HU1",""],["VT2",401,"truck10","b_motor_inf","ColorGreen","HU2",""],
		["TR9",404,"truck13","b_mech_inf","ColorBlue","AMV1",""],["TR10",405,"truck14","b_mech_inf","ColorBlue","AMV2",""],
		["TR15",406,"truck15","n_support","ColorBlue","TR1",""],["TR16",407,"truck16","n_support","ColorBlue","TR2",""],
		["TR17",412,"truck17","b_med","ColorBlue","MED",""],["TR18",413,"truck18","b_service","ColorBlue","FUEL",""],
		["TR19",414,"truck19","b_support","ColorBlue","AMMO",""],["TR20",415,"truck20","b_maint","ColorBlue","REP",""],
		["OF1",416,"offroad1","b_motor_inf","ColorBlue","OR1",""],["OF2",417,"offroad2","b_motor_inf","ColorBlue","OR2",""]
	];
	#else
	GVAR(p_vecs_blufor) = [
		["MRR1",0,"mobilerespawn1","b_hq","ColorYellow","1",(localize "STR_DOM_MISSIONSTRING_14")],["MRR2",1,"mobilerespawn2","b_hq","ColorYellow","2",(localize "STR_DOM_MISSIONSTRING_15")],
		["MEDVEC",100,"medvec","n_med","ColorGreen","M",""],["TR1",200,"truck1","n_maint","ColorGreen","R",""],
		["TR2",201,"truck2","n_support","ColorGreen","F",""],["TR3",202,"truck3","n_support","ColorGreen","A",""],
		["TR4",300,"truck4","n_service","ColorGreen","E",""],["TR5",400,"truck5","n_support","ColorGreen","T",""]
	];
		
	GVAR(p_vecs_blufor) = [
		["MRRR1",1000,"mobilerespawnE1","o_hq","ColorYellow","1",(localize "STR_DOM_MISSIONSTRING_16")],["MRRR2",1001,"mobilerespawnE2","o_hq","ColorYellow","2",(localize "STR_DOM_MISSIONSTRING_17")],
		["MEDVECR",1100,"medvecE","n_med","ColorGreen","M",""],["TRR1",1200,"truckE1","n_maint","ColorGreen","R",""],
		["TRR2",1201,"truckE2","n_support","ColorGreen","F",""],["TRR3",1202,"truckE3","n_support","ColorGreen","A",""],
		["TRR4",1300,"truckE4","n_service","ColorGreen","E",""],["TRR5",1400,"truckE5","n_support","ColorGreen","T",""]
	];
	#endif

	// is engineer
	#ifndef __TT__
	GVAR(is_engineer) = ["delta_1","delta_2","delta_3","delta_4","delta_5","delta_6"];
	#else
	GVAR(is_engineer) = ["blufor_9","blufor_10","blufor_9","blufor_10"];
	#endif

	// is artillery operator
	// please be aware that Dom 2 only supports two artillery operators in the non AI versions
	// in the AI version everybody can call in artillery though only one arty is used
	GVAR(can_use_artillery) = ["RESCUE","RESCUE2"];

	// can build mash
	#ifndef __TT__
	GVAR(is_medic) = ["alpha_6","bravo_6","charlie_6","echo_6"];
	#else
	GVAR(is_medic) = ["blufor_6","blufor_6","blufor_17","blufor_17"];
	#endif

	// can build mg nest
	#ifndef __TT__
	GVAR(can_use_mgnests) =  ["alpha_3","alpha_7","bravo_4","charlie_3","charlie_7","echo_3","echo_7"];
	#else
	GVAR(can_use_mgnests) = ["blufor_3","blufor_7","blufor_18","blufor_3","blufor_7","blufor_18"];
	#endif

	// can call in air drop
	#ifndef __TT__
	GVAR(can_call_drop_ar) = ["alpha_1","bravo_1","charlie_1","delta_1","echo_1","alpha_5","bravo_7","charlie_2","echo_2"];
	#else
	GVAR(can_call_drop_ar) = [];
	#endif
	
	// TYRGHEN
	// can call in air taxi
	#ifndef __TT__
	GVAR(can_call_taxi_ar) = ["alpha_1","bravo_1","charlie_1","delta_1","echo_1"];
	#else
	GVAR(can_call_taxi_ar) = [];
	#endif
	
	/*#ifdef __OWN_SIDE_OPFOR__
	_armor = if (GVAR(LockArmored) == 1) then {
		switch (true) do {
			default {["B_APC_Tracked_01_AA_F","B_APC_Tracked_01_rcws_F","B_MBT_01_cannon_F","B_MBT_01_arty_F","B_MBT_01_mlrs_F","B_APC_Wheeled_01_cannon_F"]};
		};
	} else {[]};
	_car = if (GVAR(LockCars) == 1) then {
		switch (true) do {
			default {["B_MRAP_01_gmg_F","B_MRAP_01_hmg_F","B_MRAP_01_F"]};
		};
	} else {[]};
	#endif
	#ifdef __OWN_SIDE_BLUFOR__
	_armor = if (GVAR(LockArmored) == 1) then {
		switch (true) do {
			default {["O_MBT_02_arty_F","O_APC_Tracked_02_cannon_F","O_MBT_02_cannon_F","O_APC_Tracked_02_AA_F","O_APC_Wheeled_02_rcws_F"]};
		};
	} else {[]};
	_car = if (GVAR(LockCars) == 1) then {
		switch (true) do {
			default {["O_MRAP_02_gmg_F","O_MRAP_02_hmg_F","O_MRAP_02_F"]};
		};
	} else {[]};
	#endif
	#ifdef __OWN_SIDE_INDEPENDENT__
	_armor = if (GVAR(LockArmored) == 1) then {["O_MBT_02_arty_F","O_APC_Tracked_02_cannon_F","O_MBT_02_cannon_F","O_APC_Tracked_02_AA_F","O_APC_Wheeled_02_rcws_F"]} else {[]};
	_car = if (GVAR(LockCars) == 1) then {["O_MRAP_02_gmg_F","O_MRAP_02_hmg_F","O_MRAP_02_F"]} else {[]};
	#endif
	#ifdef __TT__
	_armor = if (GVAR(LockArmored) == 1) then {
		["O_MBT_02_arty_F","O_APC_Tracked_02_cannon_F","O_MBT_02_cannon_F","O_APC_Tracked_02_AA_F","O_APC_Wheeled_02_rcws_F"]
	} else {[]};
	_car = if (GVAR(LockCars) == 1) then {
		["O_MRAP_02_gmg_F","O_MRAP_02_hmg_F","O_MRAP_02_F"]
	} else {[]};
	#endif
	*/

	GVAR(helilift1_types) =
	#ifdef __OWN_SIDE_OPFOR__
	switch (true) do {
		default {
			["O_APC_Tracked_02_cannon_F","O_APC_Wheeled_02_rcws_F","O_MRAP_02_gmg_F","O_MRAP_02_hmg_F","O_MRAP_02_F"]
		};
	};
	#endif
	#ifdef __OWN_SIDE_BLUFOR__
	switch (true) do {
		default {
			["B_MRAP_01_F","B_MRAP_01_gmg_F","B_MRAP_01_hmg_F","C_Offroad_01_F","B_Offroad_01_F","O_Offroad_01_F","B_Boat_Transport_01_F","B_Lifeboat","B_Boat_Armed_01_minigun_F","B_APC_Wheeled_01_cannon_F",
			"B_G_Offroad_01_F","B_G_Offroad_01_armed_F","B_G_Quadbike_01_F","B_G_Van_01_transport_F","B_APC_Tracked_01_CRV_F","B_Truck_01_ammo_F","B_Truck_01_fuel_F","B_Truck_01_medical_F","B_Truck_01_Repair_F",
			"B_Truck_01_mover_F","B_Truck_01_box_F","B_Truck_01_transport_F","B_Truck_01_covered_F","B_APC_Tracked_01_rcws_F"]
		};
	};
	#endif
	#ifdef __OWN_SIDE_INDEPENDENT__
		[];
	#endif
	#ifdef __TT__
	switch (true) do {
		default {
			["B_MRAP_01_F","B_MRAP_01_gmg_F","B_MRAP_01_hmg_F","C_Offroad_01_F","B_Offroad_01_F","O_Offroad_01_F","B_Boat_Transport_01_F","B_Lifeboat","B_Boat_Armed_01_minigun_F","B_APC_Wheeled_01_cannon_F",
			"B_G_Offroad_01_F","B_G_Offroad_01_armed_F","B_G_Quadbike_01_F","B_G_Van_01_transport_F","B_APC_Tracked_01_CRV_F","B_Truck_01_ammo_F","B_Truck_01_fuel_F","B_Truck_01_medical_F","B_Truck_01_Repair_F",
			"B_Truck_01_mover_F","B_Truck_01_box_F","B_Truck_01_transport_F","B_Truck_01_covered_F","B_APC_Tracked_01_rcws_F"]
		};
	};
	#endif
	
	if (!isMultiplayer) then {
		#ifdef __TT__
		{
			switch (_x select 1) do {
				case 0: {_x set [count _x, GVAR(helilift1_types)]};
				case 1: {_x set [count _x, GVAR(heli_wreck_lift_types)]};
			};
		} forEach GVAR(choppers_blufor);
		{
			switch (_x select 1) do {
				case 0: {_x set [count _x, GVAR(helilift1_types)]};
				case 1: {_x set [count _x, GVAR(heli_wreck_lift_types)]};
			};
		} forEach GVAR(choppers_blufor);
		#else
		{
			switch (_x select 1) do {
				case 0: {_x set [count _x, GVAR(helilift1_types)]};
				case 1: {_x set [count _x, GVAR(heli_wreck_lift_types)]};
			};
		} forEach GVAR(choppers);
		// also possible:
		// _elem = GVAR(choppers) select 2; // third chopper
		// _elem set [3, GVAR(helilift_types_custom)];
		#endif
	};

	//if (count _armor > 0) then {GVAR(helilift1_types) = [GVAR(helilift1_types), _armor] call FUNC(arrayPushStack2)};
	//if (count _car > 0) then {GVAR(helilift1_types) = [GVAR(helilift1_types), _car] call FUNC(arrayPushStack2)};

	{GVAR(helilift1_types) set [_forEachIndex, toUpper _x]} forEach GVAR(helilift1_types);

	/*#ifdef __TT__
	{
		switch (_x select 1) do {
			case 0: {_x set [count _x, GVAR(helilift1_types)]};
			case 1: {_x set [count _x, GVAR(heli_wreck_lift_types)]};
		};
	} forEach GVAR(choppers_blufor);
	{
		switch (_x select 1) do {
			case 0: {_x set [count _x, GVAR(helilift1_types)]};
			case 1: {_x set [count _x, GVAR(heli_wreck_lift_types)]};
		};
	} forEach GVAR(choppers_blufor);
	#else
	{
		switch (_x select 1) do {
			case 0: {_x set [count _x, GVAR(helilift1_types)]};
			case 1: {_x set [count _x, GVAR(heli_wreck_lift_types)]};
		};
	} forEach GVAR(choppers);
	// also possible:
	// _elem = GVAR(choppers) select 2; // third chopper
	// _elem set [3, GVAR(helilift_types_custom)];
	#endif
	*/

	GVAR(prim_weap_player) = "";
	GVAR(last_telepoint) = 0;
	GVAR(chophud_on) = true;

	// show a welcome message in a chopper (mainly used to tell the player if it is a lift or wreck lift chopper).
	// false = disable it
	//GVAR(show_chopper_welcome) = GVAR(WithChopHud);

	GVAR(backpackclasses) = [
		[ // blufor
			"B_AssaultPack_khk", "B_AssaultPack_dgtl", "B_AssaultPack_rgr", "B_AssaultPack_sgg", "B_AssaultPack_blk", "B_AssaultPack_blk", "B_AssaultPack_cbr",
			"B_AssaultPack_mcamo", "B_Kitbag_mcamo", "B_Kitbag_sgg", "B_Kitbag_cbr", "B_Bergen_sgg", "B_Bergen_mcamo", "B_Bergen_rgr", "B_Bergen_blk", "B_FieldPack_blk", "B_FieldPack_cbr",
			"B_Carryall_mcamo", "B_AssaultPack_rgr_LAT", "B_AssaultPack_rgr_Medic", "B_AssaultPack_rgr_Repair", "B_AssaultPack_blk_DiverExp", "B_Kitbag_rgr_Exp",
			"B_FieldPack_blk_DiverExp"
		],
		[ // opfor
			"Tripod_Bag", "DSHKM_TK_GUE_Bag_EP1", "KORD_high_TK_Bag_EP1", "KORD_TK_Bag_EP1", "AGS_TK_Bag_EP1", "2b14_82mm_TK_Bag_EP1", "Metis_TK_Bag_EP1", "TK_RPG_Backpack_EP1",
			"TK_ALICE_Pack_EP1", "TK_Assault_Pack_EP1"
		]
	];

	GVAR(jump_helo) = ["O_Heli_Light_02_unarmed_F", "B_Heli_Transport_01_F", "I_Heli_Transport_02_F"];

	GVAR(headbug_vehicle) = "B_Quadbike_01_F";

	/*if (GVAR(with_ai)) then {
		// additional AI recruit buildings
		// these have to be placed in the editor, give them a var name in the editor
		// only client handling means, no damage handling done for those buildings (contrary to the standard AI hut)
		// example:
		// GVAR(additional_recruit_buildings) = [my_ai_building1, my_ai_building2];
		GVAR(additional_recruit_buildings) = [];
	};*/

	// if the array is empty, anybody with a pilot uniform and headgear can fly (if the latter is enabled)
	// if you add the string name of playable units (var name in the editor) only those players get a pilot uniform and headgear
	// makes only sense when only pilots can fly is enabled
	// for example: ["pilot_1","pilot_2"];, case sensitiv
	GVAR(only_pilots_can_fly) = [];

	GVAR(do_ma_update_n) = false;
	
	/*_allowrecompile = getNumber(missionConfigFile/"allowFunctionsRecompile") == 1;
	if (!GVAR(with_ranked)) then {
		FUNC(weaponcargo) = if (_allowrecompile) then {
			compile preprocessFileLineNumbers "x_client\x_weaponcargo_a3.sqf";
		} else {
			compileFinal preprocessFileLineNumbers "x_client\x_weaponcargo_a3.sqf";
		};
	} else {
		FUNC(weaponcargo) = if (_allowrecompile) then {
			compile preprocessFileLineNumbers "x_client\x_weaponcargor_a3.sqf";
		} else {
			compileFinal preprocessFileLineNumbers "x_client\x_weaponcargor_a3.sqf";
		};
	};*/

	// TYRGHEN - global var initialization
	GVAR(ari_flare_height)=150;
	GVAR(sum_camps) = 0;

	GVAR(misc_store) = GVAR(HeliHEmpty) createVehicleLocal [0,0,0];
	
	// GVAR(muzzle_store) = GVAR(HeliHEmpty) createVehicleLocal [0, 0, 0];
	// ["Throw"] call FUNC(getMagsAndMuzzles);
	// ["Put"] call FUNC(getMagsAndMuzzles);
	
	GVAR(client_init_trig) = createTrigger ["EmptyDetector", [0,0,0]];
	GVAR(client_init_trig) setTriggerArea [0,0,0,false];
	GVAR(client_init_trig) setTriggerActivation ["NONE", "PRESENT", false];
	GVAR(client_init_trig) setTriggerTimeout [1, 1, 1, false];
	X_INIT = false;
	GVAR(client_init_trig) setTriggerStatements ["X_INIT && {!isNil 'd_init_processed'}", "diag_log [diag_frameno, diag_tickTime, time, 'Executing Dom local player JIP trigger'];call compile preprocessFileLineNumbers 'x_client\x_jip.sqf'", ""];
	FUNC(preloadfin) = {
		[GVAR(prl_fin_id), "onPreloadFinished"] call BFUNC(removeStackedEventHandler);
		GVAR(prl_fin_id) = nil;
		FUNC(preloadfin) = nil;
		GVAR(preloaddone) = true;
	};
	GVAR(prl_fin_id) = ["DOM_ID", "onPreloadFinished", "d_fnc_preloadfin"] call BFUNC(addStackedEventHandler);
	execVM "tasks.sqf";
};

tf_no_auto_long_range_radio = true;
diag_log [diag_frameno, diag_ticktime, time, "Dom fn_preinit.sqf processed"];